﻿/*************************************************************************
*																		 *
*				code by Miles Chen (v-mich) 2008.4.5					 *
*																		 *
*																		 *
*************************************************************************/


#include "stdafx.h"
#include "mainform.h"

BOOL RegisterNSClass(LPTSTR lpClassName)
{
	WNDCLASSEXW wcx;
	if(GetClassInfoExW(GetModuleHandleW(NULL), L"#32770", &wcx))
	{
		// magic stuff
		wcx.lpszClassName = lpClassName;

		RegisterClassExW(&wcx);
		return TRUE;
	}
	else
	{
		return FALSE;
	}
}

void AppEntry(void)
{
	if(!SingleInstance(L"NetShare_Runtime"))
		return;

	//if(!RegisterNSClass(L"$NS_DIALOG"))
	//{
	//	MessageBox(NULL, L"Failed to register NS class", L"Fatal Error", MB_OK | MB_ICONERROR);
	//	return;
	//}

	CMainForm p;
	p.DoModal();
}

int APIENTRY _tWinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPTSTR    lpCmdLine,
                     int       nCmdShow)
{
	return AppMain(AppEntry);
}